/*  1:   */ package org.jetbrains.debugger;
/*  2:   */ 
/*  3:   */

import com.intellij.xdebugger.frame.XCompositeNode;
import com.intellij.xdebugger.frame.XValueChildrenList;
import com.intellij.xdebugger.frame.XValueGroup;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.debugger.values.ArrayValue;

import java.util.List;

/*  4:   */
/*  5:   */
/*  6:   */
/*  7:   */
/*  8:   */
/*  9:   */
/* 10:   */ 
/* 11:   */ final class LazyVariablesGroup
/* 12:   */   extends XValueGroup
/* 13:   */ {
/* 14:13 */   public static final ValueGroupFactory<ArrayValue> GROUP_FACTORY = new ValueGroupFactory()
/* 15:   */   {
/* 16:   */     public XValueGroup create(@NotNull ArrayValue paramAnonymousArrayValue, int paramAnonymousInt1, int paramAnonymousInt2, @NotNull VariableContext paramAnonymousVariableContext)
/* 17:   */     {
/* 18:16 */       if (paramAnonymousArrayValue == null) {
/* 19:16 */         throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/jetbrains/debugger/LazyVariablesGroup$1", "create" }));
/* 20:   */       }
/* 21:16 */       if (paramAnonymousVariableContext == null) {
/* 22:16 */         throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "3", "org/jetbrains/debugger/LazyVariablesGroup$1", "create" }));
/* 23:   */       }
/* 24:16 */       return new LazyVariablesGroup(paramAnonymousArrayValue, paramAnonymousInt1, paramAnonymousInt2, paramAnonymousVariableContext);
/* 25:   */     }
/* 26:   */   };
/* 27:   */   private final ArrayValue a;
/* 28:   */   private final int b;
/* 29:   */   private final int c;
/* 30:   */   private final VariableContext d;
/* 31:   */   
/* 32:   */   public LazyVariablesGroup(@NotNull ArrayValue paramArrayValue, int paramInt1, int paramInt2, @NotNull VariableContext paramVariableContext)
/* 33:   */   {
/* 34:27 */     super(String.format("[%,d … %,d]", new Object[] { Integer.valueOf(paramInt1), Integer.valueOf(paramInt2) }));
/* 35:   */     
/* 36:29 */     this.a = paramArrayValue;
/* 37:   */     
/* 38:31 */     this.b = paramInt1;
/* 39:32 */     this.c = paramInt2;
/* 40:   */     
/* 41:34 */     this.d = paramVariableContext;
/* 42:   */   }
/* 43:   */   
/* 44:   */   public void computeChildren(@NotNull XCompositeNode paramXCompositeNode)
/* 45:   */   {
/* 46:39 */     if (paramXCompositeNode == null) {
/* 47:39 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/jetbrains/debugger/LazyVariablesGroup", "computeChildren" }));
/* 48:   */     }
/* 49:39 */     paramXCompositeNode.setAlreadySorted(true);
/* 50:   */     
/* 51:41 */     this.a.getVariables(this.b, this.c, 100, new VariableView.ObsolescentIndexedVariablesConsumer(paramXCompositeNode)
/* 52:   */     {
/* 53:   */       public void consumeRanges(@Nullable int[] paramAnonymousArrayOfInt)
/* 54:   */       {
/* 55:44 */         if (paramAnonymousArrayOfInt == null)
/* 56:   */         {
/* 57:45 */           XValueChildrenList localXValueChildrenList = new XValueChildrenList();
/* 58:46 */           LazyVariablesGroup.addGroups(LazyVariablesGroup.this.a, LazyVariablesGroup.GROUP_FACTORY, localXValueChildrenList, LazyVariablesGroup.this.b, LazyVariablesGroup.this.c, 100, LazyVariablesGroup.this.d);
/* 59:47 */           this.node.addChildren(localXValueChildrenList, true);
/* 60:   */         }
/* 61:   */         else
/* 62:   */         {
/* 63:50 */           LazyVariablesGroup.addRanges(LazyVariablesGroup.this.a, paramAnonymousArrayOfInt, this.node, LazyVariablesGroup.this.d, true);
/* 64:   */         }
/* 65:   */       }
/* 66:   */       
/* 67:   */       public void consumeVariables(@NotNull List<Variable> paramAnonymousList)
/* 68:   */       {
/* 69:56 */         if (paramAnonymousList == null) {
/* 70:56 */           throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/jetbrains/debugger/LazyVariablesGroup$2", "consumeVariables" }));
/* 71:   */         }
/* 72:56 */         this.node.addChildren(Variables.createVariablesList(paramAnonymousList, LazyVariablesGroup.this.d), true);
/* 73:   */       }
/* 74:   */     });
/* 75:   */   }
/* 76:   */   
/* 77:   */   public static void addRanges(@NotNull ArrayValue paramArrayValue, int[] paramArrayOfInt, @NotNull XCompositeNode paramXCompositeNode, @NotNull VariableContext paramVariableContext, boolean paramBoolean)
/* 78:   */   {
/* 79:62 */     if (paramArrayValue == null) {
/* 80:62 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/jetbrains/debugger/LazyVariablesGroup", "addRanges" }));
/* 81:   */     }
/* 82:62 */     if (paramXCompositeNode == null) {
/* 83:62 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "2", "org/jetbrains/debugger/LazyVariablesGroup", "addRanges" }));
/* 84:   */     }
/* 85:62 */     if (paramVariableContext == null) {
/* 86:62 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "3", "org/jetbrains/debugger/LazyVariablesGroup", "addRanges" }));
/* 87:   */     }
/* 88:62 */     XValueChildrenList localXValueChildrenList = new XValueChildrenList(paramArrayOfInt.length / 2);
/* 89:63 */     int i = 0;
/* 90:63 */     for (int j = paramArrayOfInt.length; i < j; i += 2) {
/* 91:64 */       localXValueChildrenList.addTopGroup(new LazyVariablesGroup(paramArrayValue, paramArrayOfInt[i], paramArrayOfInt[(i + 1)], paramVariableContext));
/* 92:   */     }
/* 93:66 */     paramXCompositeNode.addChildren(localXValueChildrenList, paramBoolean);
/* 94:   */   }
/* 95:   */   
/* 96:   */   public static <T> void addGroups(@NotNull T paramT, @NotNull ValueGroupFactory<T> paramValueGroupFactory, @NotNull XValueChildrenList paramXValueChildrenList, int paramInt1, int paramInt2, int paramInt3, @NotNull VariableContext paramVariableContext)
/* 97:   */   {
/* 98:76 */     if (paramT == null) {
/* 99:76 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/jetbrains/debugger/LazyVariablesGroup", "addGroups" }));
/* :0:   */     }
/* :1:76 */     if (paramValueGroupFactory == null) {
/* :2:76 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "1", "org/jetbrains/debugger/LazyVariablesGroup", "addGroups" }));
/* :3:   */     }
/* :4:76 */     if (paramXValueChildrenList == null) {
/* :5:76 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "2", "org/jetbrains/debugger/LazyVariablesGroup", "addGroups" }));
/* :6:   */     }
/* :7:76 */     if (paramVariableContext == null) {
/* :8:76 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "6", "org/jetbrains/debugger/LazyVariablesGroup", "addGroups" }));
/* :9:   */     }
/* ;0:76 */     int i = Math.min(paramInt3, paramInt2);
/* ;1:77 */     int j = 0;
/* ;2:   */     do
/* ;3:   */     {
/* ;4:79 */       int k = paramInt1;
/* ;5:80 */       int m = i;
/* ;6:   */       
/* ;7:82 */       paramInt1 += paramInt3;
/* ;8:83 */       i = paramInt1 + Math.min(paramInt3, paramInt2 - paramInt1);
/* ;9:86 */       if (i - paramInt1 == 1)
/* <0:   */       {
/* <1:87 */         m++;
/* <2:88 */         j = 1;
/* <3:   */       }
/* <4:90 */       paramXValueChildrenList.addTopGroup(paramValueGroupFactory.create(paramT, k, m, paramVariableContext));
/* <5:91 */     } while ((paramInt1 < paramInt2) && 
/* <6:   */     
/* <7:   */ 
/* <8:   */ 
/* <9:95 */       (j == 0));
/* =0:   */   }
/* =1:   */ }



/* Location:           E:\idea\

 * Qualified Name:     org.jetbrains.debugger.LazyVariablesGroup

 * JD-Core Version:    0.7.0.1

 */